<%-- 
    Document   : response
    Created on : 27 févr. 2012, 15:30:47
    Author     : assia
--%>
<%@page import="java.text.ParseException"%>
<%@page import="java.text.ParseException"%>
<%@page import="com.sun.java.swing.plaf.windows.WindowsBorders.DashedBorder"%>
<%@page import="comits.web.client.servlets.DateUtil"%>
<%@page import="javax.print.DocFlavor.STRING"%>
<%@page import="java.text.DateFormat"%>
<%@page import="java.text.SimpleDateFormat"%>

<%@page import="java.util.Calendar"%>
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="d" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
        <title>JSP Page</title>
        <link href="styles.css" rel="stylesheet" type="text/css"/>
    </head>
    <body>
        <div class="text" align="center">
            <p>
                <%
                    String datejour = (String) request.getAttribute("datejour");
                    java.sql.Date d = new java.sql.Date(DateUtil.stringToDate(datejour).getTime());
                    // java.sql.Date datejour1=new java.sql.Date(d.getTime());
                  //  System.out.println("daaattte jourrr " + d);
                      String NumCmd = (String) request.getAttribute("NumCmd");
                    //String expediteur = (String) request.getAttribute("expediteur");
                    //String numExpediteur = (String) request.getAttribute("numexpediteur");
                    //String destinataire = (String) request.getAttribute("destinataire");
                    //String numdestinataire = (String) request.getAttribute("numdestinataire");
                    //out.println("le " + expediteur + " " + numExpediteur + " approvisionne " + " la " + destinataire + " " + numdestinataire);
                      //out.println("la commande " + NumCmd + " " + datejour);
                %>  
            </p>
        </div>
        <sql:query var = "queryresults" dataSource = "jdbc/WebTest1" > 
            <%-- select distinct *  from comits_base.commande where WEEK(DateRecepPrevue)= <%=week%>   --%> 
          <%--  select * from comits_base.lignecmd  where DateReception like '<%=d%>' and NumExp='<%=numExpediteur%>' and Expediteur='<%=expediteur%>' 
            and NumDest='<%=numdestinataire%>' and  Destinataire='<%=destinataire%>'  
          --%>
            select * from comits_base.lignecmd  where DateReception like '<%=d%>' and NumCmd='<%=NumCmd%>' 
       
        </sql:query> 
        <div id="contener1" align="" >
            <div id="pannel_1">
                <c:forEach var="row" items="${queryresults.rows}" varStatus="status" >

                    <div >  
                        <form action="PlanningServlet" method="get">
                                                        <input  type="submit"  name="action1" class="button"  value="${row.NumCmd}" />  
                        </form>
                    </div>
                    <br/>

                </c:forEach>
            </div>
            <div id="pannel_2">
                <c:forEach var="row" items="${queryresults.rows}" varStatus="status" >
                    <div >  
                        <form action="PlanningServlet" method="get">
                            <input  type="submit"  name="action1" class="button"  value="${row.NumPdt}" />  
                        </form>
                    </div>
                    <br/>
                </c:forEach>
            </div>
            <div id="pannel_3">
                <c:forEach var="row" items="${queryresults.rows}" varStatus="status" >
                    <div >  
                        <form action="PlanningServlet" method="get">
                            <input  type="submit"  name="action1" class="button"  value="${row.Quantite}" />  
                        </form>
                    </div>
                    <br/>
                </c:forEach>
            </div>
            <div id="pannel_4">
                <c:forEach var="row" items="${queryresults.rows}" varStatus="status" >
                    <div >  
                        <form action="PlanningServlet" method="get">
                            <input  type="submit"  name="action1" class="button"  value="${row.DateReception}" />  
                        </form>
                    </div>
                    <br/>
                </c:forEach>
            </div>
            <div id="pannel_5">
                <c:forEach var="row" items="${queryresults.rows}" varStatus="status" >
                    <div >  
                        <form action="PlanningServlet" method="get">
                            <input  type="submit"  name="action1" class="button"  value="${row.Statut}" />  
                        </form>
                    </div>
                    <br/>

                </c:forEach>
            </div>
            <div id="pannel_6">
                <c:forEach var="row" items="${queryresults.rows}" varStatus="status" >
                    <div >  
                        <form action="PlanningServlet" method="get">
                            <input  type="submit"  name="action1" class="button"  value="${row.DateStatut}" />  
                        </form>
                    </div>
                    <br/>
                </c:forEach>
            </div>          
        </div>


        <table border=1 >
            <tr>
                <th>Numero Commande </th><th>Numero Produit</th><th>Quantite</th><th>Date Reception</th><th>Statut</th><th>Date Statut</th>
            </tr>

            <c:forEach var="row" items="${queryresults.rows}">
                <tr>
                    <td><c:out value="${row.NumCmd}" /></td>
                    <td><c:out value="${row.NumPdt}" /></td>
                    <td><c:out value="${row.Quantite}" /></td>
                    <td><c:out value="${row.DateReception}" /></td>
                    <td><c:out value="${row.Statut}" /></td> 
                    <td><c:out value="${row.DateStatut}" /></td> 
                </tr>

            </c:forEach>  
        </table>

    </body>
</html>
